﻿public class TreeNode
{
    private TreeNode left;
    private TreeNode right;
    private int value;

    public TreeNode(int value)
    {
        this.value = value;
        this.left = null;
        this.right = null;
    }

    public TreeNode(int value, TreeNode left, TreeNode right)
    {
        this.value = value;
        this.left = left;
        this.right = right;
    }

    public TreeNode Left
    {
        get
        {
            return left;
        }
        set
        {
            left = value;
        }
    }

    public TreeNode Right
    {
        get
        {
            return right;
        }
        set
        {
            right = value;
        }
    }

    public int Value
    {
        get
        {
            return value;
        }
        set
        {
            value = value;
        }
    }
}